<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/plugins/vue/dist/vue.js"></script>
    <script src="js/plugins/axios/dist/axios.js"></script>
    <script src="js/common.js"></script>
</head>
<body>
    <div id="app"></div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {

        },
        methods: {

        },
        mounted(){
            let url = location.href
            let paramObj = parseUrlParams2Obj(url)
            console.log(paramObj)
            //封装请求参数
            this.$http.post('/login/wechat',paramObj)
                .then(result=>{
                    console.log(result);
                    result = result.data;
                    if (result.success) {
                        let {token,logininfo} = result.resultObj;
                        localStorage.setItem("token", token);
                        localStorage.setItem("logininfo", JSON.stringify(logininfo));
                        location.href = "/index.html"
                    } else {
                        location.href = result.resultObj;
                    }
                })
                .catch(result=>{
                    console.log(result)
                    alert("系统繁忙,请稍后重试!")
                })
        }
    })
</script>
</html>